package org.xy.dao;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

@Component("basicDAO")
public class BasicDAO {

	protected final Logger logger = LoggerFactory.getLogger(this.getClass());

	@Resource
	protected JdbcTemplate jdbcTemplate;

	public JdbcTemplate getJdbcTemplate() {
		return this.jdbcTemplate;
	}

	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}

	public void executeSQL(String sql) {
		this.logger.info("Execute SQL:" + sql);
		this.jdbcTemplate.execute(sql);
	}
}
